package uk.ac.ncl.carrent.tests;

import static org.junit.Assert.*;

import java.util.Calendar;
import java.util.GregorianCalendar;

import org.junit.Test;

import uk.ac.ncl.carrent.*;

public class LicenceNumberTest {

	@Test
	public void testLicenceNumber() {
		Person p = new Person("Shiwei", "He", "5/9/1987");
		Calendar issueDate = new GregorianCalendar(2000, 1, 1);
		final LicenceNumber licence = LicenceNumber.getInstance(p, issueDate, 111);
		assertEquals("SH", licence.getInitials());
		assertEquals(2000, licence.getYear());
		assertEquals(111, p.getDob());
		assertEquals("SH-2000-111", licence.toString());
	}

}
